import { useIntersectionObserver } from '@vueuse/core';

export default {
  mounted(el, binding) {
    useIntersectionObserver(el, ([{ isIntersecting }]) => {
      // 判断当前监听元素是否进入视口区域
      if (isIntersecting) {
        el.src = binding.value;
      }
    });
  }
};
